// =====================================================================
// <copyright file="ValidationBase.cs" author="David R. Guindo">
// 	Copyright (C) 2013. All rights reserved.
// </copyright>
// =====================================================================
// This code is released under the terms of the Apache 2.0 license, 
// http://apache.org/licenses/LICENSE-2.0.html
// =====================================================================

namespace AppBlock.Core.Validations
{
    /// <summary>
    /// </summary>
    public class ValidationBase
    {
        /// <summary>
        ///     Initializes a new instance of the <see cref="ValidationBase" /> class.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="propertyName">Name of the property.</param>
        /// <param name="description">The description.</param>
        public ValidationBase(ValidationType type, string propertyName, string description)
        {
            this.PropertyName = propertyName;
            this.Description = description;
            this.ValidationType = type;
        }

        /// <summary>
        ///     Gets or sets the description.
        /// </summary>
        /// <value> The description. </value>
        public string Description { get; private set; }

        /// <summary>
        ///     Gets or sets the name of the property.
        /// </summary>
        /// <value> The name of the property. </value>
        public string PropertyName { get; private set; }

        /// <summary>
        ///     Gets or sets the name of the property.
        /// </summary>
        /// <value> The name of the property. </value>
        public ValidationType ValidationType { get; private set; }

        /// <summary>
        ///     Returns a <see cref="System.String" /> that represents this instance.
        /// </summary>
        /// <returns>
        ///     A <see cref="System.String" /> that represents this instance.
        /// </returns>
        public override string ToString()
        {
            return string.Format("Error: [{0}]:\t{1}\t{2}", this.PropertyName, this.ValidationType, this.Description);
        }
    }
}